<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.17"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>QuEST: QuEST_qasm.h File Reference</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="style.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand"><img alt="Logo" src="logo.png"/></a>
                    <a class="navbar-brand"><b>QuEST</b> v3.2.0<br>The Quantum Exact Simulation Toolkit</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_70834f0dcd10de01d2e35ab402a2238e.html">tysonjones</a></li><li class="navelem"><a class="el" href="dir_1957401ef452be7528010ba0f4832a45.html">Desktop</a></li><li class="navelem"><a class="el" href="dir_dee4414d5d72b49a9429e079789ffd08.html">GithubRepos</a></li><li class="navelem"><a class="el" href="dir_a89b43d59316bb5045aa22bb53a67d29.html">QuEST</a></li><li class="navelem"><a class="el" href="dir_f1fe56bf5ef15ff22696c757278c6962.html">QuEST</a></li><li class="navelem"><a class="el" href="dir_757750313c878cfe3b7d1ade55b4b819.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">QuEST_qasm.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="QuEST_8h_source.html">QuEST.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="QuEST__precision_8h_source.html">QuEST_precision.h</a>&quot;</code><br />
</div>
<p><a href="QuEST__qasm_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a32bbd0276b80668812ac248cd81c725f"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> { <br />
&#160;&#160;<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725faa29b98cbb581abf5ec338a1763de7a1b">GATE_SIGMA_Y</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa228cd6a7ad18928b794ee7ad1f1fc85e">GATE_SIGMA_Z</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fadfa058950331ffdba0bf56cb2272e01f">GATE_T</a>, 
<br />
&#160;&#160;<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa5053f3d968443bc04e8b1d09f18bab9a">GATE_S</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9">GATE_HADAMARD</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fada07505b73935b2788032efd30a1a361">GATE_ROTATE_X</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fae1267d5de573dc2901aa8e724ac1d689">GATE_ROTATE_Y</a>, 
<br />
&#160;&#160;<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa7b60ebf9485dea5506345487c903c7d3">GATE_ROTATE_AROUND_AXIS</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507">GATE_PHASE_SHIFT</a>, 
<br />
&#160;&#160;<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab12d052de2b7c59c6ab87710fd7d3c78">GATE_SWAP</a>, 
<a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab656861dfb036cbcf7009f02a8949253">GATE_SQRT_SWAP</a>
<br />
 }</td></tr>
<tr class="memdesc:a32bbd0276b80668812ac248cd81c725f"><td class="mdescLeft">&#160;</td><td class="mdescRight">! Identifiers of single-target gates  <a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">More...</a><br /></td></tr>
<tr class="separator:a32bbd0276b80668812ac248cd81c725f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af2cdfa07be122a2c0b0e950ef45450bc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#af2cdfa07be122a2c0b0e950ef45450bc">qasm_clearRecorded</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:af2cdfa07be122a2c0b0e950ef45450bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5ef90741274785eb1ebbbe828b7df8a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#ae5ef90741274785eb1ebbbe828b7df8a">qasm_free</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:ae5ef90741274785eb1ebbbe828b7df8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d97fdaec443ed238c1e72e387a688e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a9d97fdaec443ed238c1e72e387a688e3">qasm_printRecorded</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:a9d97fdaec443ed238c1e72e387a688e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42607270d63948acf84d6def787213e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a42607270d63948acf84d6def787213e8">qasm_recordAxisRotation</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> angle, <a class="el" href="structVector.html">Vector</a> axis, int targetQubit)</td></tr>
<tr class="separator:a42607270d63948acf84d6def787213e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a385fde708958617bbeb599064b8dcb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, char *comment,...)</td></tr>
<tr class="separator:a9a385fde708958617bbeb599064b8dcb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a518c4351d574aea8477019dbce02f09c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a518c4351d574aea8477019dbce02f09c">qasm_recordCompactUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplex.html">Complex</a> alpha, <a class="el" href="structComplex.html">Complex</a> beta, int targetQubit)</td></tr>
<tr class="separator:a518c4351d574aea8477019dbce02f09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33be8162c9633bb8015f06b38cf70735"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a33be8162c9633bb8015f06b38cf70735">qasm_recordControlledAxisRotation</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> angle, <a class="el" href="structVector.html">Vector</a> axis, int controlQubit, int targetQubit)</td></tr>
<tr class="separator:a33be8162c9633bb8015f06b38cf70735"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6bd68fa9c0c1bd9c9f9af714ea0b8b03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a6bd68fa9c0c1bd9c9f9af714ea0b8b03">qasm_recordControlledCompactUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplex.html">Complex</a> alpha, <a class="el" href="structComplex.html">Complex</a> beta, int controlQubit, int targetQubit)</td></tr>
<tr class="separator:a6bd68fa9c0c1bd9c9f9af714ea0b8b03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4c380db9eda18892d5a86825fa4b165"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#aa4c380db9eda18892d5a86825fa4b165">qasm_recordControlledGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int controlQubit, int targetQubit)</td></tr>
<tr class="separator:aa4c380db9eda18892d5a86825fa4b165"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae776148507b8f769cd00d1603212a028"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#ae776148507b8f769cd00d1603212a028">qasm_recordControlledParamGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int controlQubit, int targetQubit, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> param)</td></tr>
<tr class="separator:ae776148507b8f769cd00d1603212a028"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e99d405002cdf6ddd40922911d058a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a5e99d405002cdf6ddd40922911d058a4">qasm_recordControlledUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a> u, int controlQubit, int targetQubit)</td></tr>
<tr class="memdesc:a5e99d405002cdf6ddd40922911d058a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">additionally performs Rz on target to restore the global phase lost from u in QASM U(a,b,c)  <a href="QuEST__qasm_8h.html#a5e99d405002cdf6ddd40922911d058a4">More...</a><br /></td></tr>
<tr class="separator:a5e99d405002cdf6ddd40922911d058a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81749d23b8c3c1acf87c9db675872c24"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a81749d23b8c3c1acf87c9db675872c24">qasm_recordGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int targetQubit)</td></tr>
<tr class="separator:a81749d23b8c3c1acf87c9db675872c24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55d0f243437a0bb3b7609a1090323aa3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a55d0f243437a0bb3b7609a1090323aa3">qasm_recordInitClassical</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, long long int stateInd)</td></tr>
<tr class="separator:a55d0f243437a0bb3b7609a1090323aa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a627b0be7667c5a61a06b3b038fcc8b1b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a627b0be7667c5a61a06b3b038fcc8b1b">qasm_recordInitPlus</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:a627b0be7667c5a61a06b3b038fcc8b1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e21adca1f0ca03303bc2e57aaba4ce2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a4e21adca1f0ca03303bc2e57aaba4ce2">qasm_recordInitZero</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:a4e21adca1f0ca03303bc2e57aaba4ce2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0befde437a58ef8fe38495bfc2a16f0e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a0befde437a58ef8fe38495bfc2a16f0e">qasm_recordMeasurement</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, int measureQubit)</td></tr>
<tr class="separator:a0befde437a58ef8fe38495bfc2a16f0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abecd71c919a35e5a87b07ba400edc7c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#abecd71c919a35e5a87b07ba400edc7c2">qasm_recordMultiControlledGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int *controlQubits, int numControlQubits, int targetQubit)</td></tr>
<tr class="separator:abecd71c919a35e5a87b07ba400edc7c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1445a08d034806627cc0b5aa0f4f6d3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a1445a08d034806627cc0b5aa0f4f6d3a">qasm_recordMultiControlledParamGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int *controlQubits, int numControlQubits, int targetQubit, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> param)</td></tr>
<tr class="separator:a1445a08d034806627cc0b5aa0f4f6d3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a79e4305d35f1756b8438bbd34ea6cc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a3a79e4305d35f1756b8438bbd34ea6cc">qasm_recordMultiControlledUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a> u, int *controlQubits, int numControlQubits, int targetQubit)</td></tr>
<tr class="memdesc:a3a79e4305d35f1756b8438bbd34ea6cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">additionally performs Rz on target to restore the global phase lost from u in QASM U(a,b,c)  <a href="QuEST__qasm_8h.html#a3a79e4305d35f1756b8438bbd34ea6cc">More...</a><br /></td></tr>
<tr class="separator:a3a79e4305d35f1756b8438bbd34ea6cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9975b6f54f4090cdf851958bc2b37230"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a9975b6f54f4090cdf851958bc2b37230">qasm_recordMultiStateControlledUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a> u, int *controlQubits, int *controlState, int numControlQubits, int targetQubit)</td></tr>
<tr class="separator:a9975b6f54f4090cdf851958bc2b37230"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabeb3e9ec6b2f30938c4cf9592e624fa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#aabeb3e9ec6b2f30938c4cf9592e624fa">qasm_recordParamGate</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a> gate, int targetQubit, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> param)</td></tr>
<tr class="separator:aabeb3e9ec6b2f30938c4cf9592e624fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad22260712869e79f07d2f04e2b41a233"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#ad22260712869e79f07d2f04e2b41a233">qasm_recordUnitary</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a> u, int targetQubit)</td></tr>
<tr class="separator:ad22260712869e79f07d2f04e2b41a233"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5f05644a6cea13e00f828658bcf7a68"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#aa5f05644a6cea13e00f828658bcf7a68">qasm_setup</a> (<a class="el" href="structQureg.html">Qureg</a> *qureg)</td></tr>
<tr class="separator:aa5f05644a6cea13e00f828658bcf7a68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84b0328814c0b17e127396cb36065108"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a84b0328814c0b17e127396cb36065108">qasm_startRecording</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:a84b0328814c0b17e127396cb36065108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77ad622c5ba852708a80755ac1792288"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a77ad622c5ba852708a80755ac1792288">qasm_stopRecording</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="separator:a77ad622c5ba852708a80755ac1792288"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39aeacb22460bd1430129795761ade28"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="QuEST__qasm_8h.html#a39aeacb22460bd1430129795761ade28">qasm_writeRecordedToFile</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, char *filename)</td></tr>
<tr class="memdesc:a39aeacb22460bd1430129795761ade28"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns success of file write  <a href="QuEST__qasm_8h.html#a39aeacb22460bd1430129795761ade28">More...</a><br /></td></tr>
<tr class="separator:a39aeacb22460bd1430129795761ade28"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions for generating QASM output from QuEST circuits</p>
<dl class="section author"><dt>Author</dt><dd>Tyson Jones </dd></dl>

<p class="definition">Definition in file <a class="el" href="QuEST__qasm_8h_source.html">QuEST_qasm.h</a>.</p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a32bbd0276b80668812ac248cd81c725f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32bbd0276b80668812ac248cd81c725f">&#9670;&nbsp;</a></span>TargetGate</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>! Identifiers of single-target gates </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55"></a>GATE_SIGMA_X&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725faa29b98cbb581abf5ec338a1763de7a1b"></a>GATE_SIGMA_Y&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa228cd6a7ad18928b794ee7ad1f1fc85e"></a>GATE_SIGMA_Z&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fadfa058950331ffdba0bf56cb2272e01f"></a>GATE_T&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa5053f3d968443bc04e8b1d09f18bab9a"></a>GATE_S&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9"></a>GATE_HADAMARD&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fada07505b73935b2788032efd30a1a361"></a>GATE_ROTATE_X&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fae1267d5de573dc2901aa8e724ac1d689"></a>GATE_ROTATE_Y&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877"></a>GATE_ROTATE_Z&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa7b60ebf9485dea5506345487c903c7d3"></a>GATE_ROTATE_AROUND_AXIS&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7"></a>GATE_UNITARY&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507"></a>GATE_PHASE_SHIFT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fab12d052de2b7c59c6ab87710fd7d3c78"></a>GATE_SWAP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a32bbd0276b80668812ac248cd81c725fab656861dfb036cbcf7009f02a8949253"></a>GATE_SQRT_SWAP&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8h_source.html#l00020">20</a> of file <a class="el" href="QuEST__qasm_8h_source.html">QuEST_qasm.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;             {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a>,</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725faa29b98cbb581abf5ec338a1763de7a1b">GATE_SIGMA_Y</a>,</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa228cd6a7ad18928b794ee7ad1f1fc85e">GATE_SIGMA_Z</a>,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fadfa058950331ffdba0bf56cb2272e01f">GATE_T</a>,</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa5053f3d968443bc04e8b1d09f18bab9a">GATE_S</a>,</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9">GATE_HADAMARD</a>,</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fada07505b73935b2788032efd30a1a361">GATE_ROTATE_X</a>,</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fae1267d5de573dc2901aa8e724ac1d689">GATE_ROTATE_Y</a>,</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>,</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa7b60ebf9485dea5506345487c903c7d3">GATE_ROTATE_AROUND_AXIS</a>,</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>,</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507">GATE_PHASE_SHIFT</a>,</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab12d052de2b7c59c6ab87710fd7d3c78">GATE_SWAP</a>,</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab656861dfb036cbcf7009f02a8949253">GATE_SQRT_SWAP</a></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;} <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>;</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="af2cdfa07be122a2c0b0e950ef45450bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2cdfa07be122a2c0b0e950ef45450bc">&#9670;&nbsp;</a></span>qasm_clearRecorded()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_clearRecorded </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00477">477</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;                                     {</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;    </div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;    <span class="comment">// maintains current buffer size</span></div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    (qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;buffer)[0] = <span class="charliteral">&#39;\0&#39;</span>;</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;bufferFill = 0;</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00095">clearRecordedQASM()</a>.</p>

</div>
</div>
<a id="ae5ef90741274785eb1ebbbe828b7df8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5ef90741274785eb1ebbbe828b7df8a">&#9670;&nbsp;</a></span>qasm_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00500">500</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;                            {</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;    </div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;    free(qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;buffer);</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;    free(qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>);</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00077">destroyQureg()</a>.</p>

</div>
</div>
<a id="a9d97fdaec443ed238c1e72e387a688e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d97fdaec443ed238c1e72e387a688e3">&#9670;&nbsp;</a></span>qasm_printRecorded()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_printRecorded </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00484">484</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;                                     {</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    printf(<span class="stringliteral">&quot;%s&quot;</span>, qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;buffer);</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00099">printRecordedQASM()</a>.</p>

</div>
</div>
<a id="a42607270d63948acf84d6def787213e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42607270d63948acf84d6def787213e8">&#9670;&nbsp;</a></span>qasm_recordAxisRotation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordAxisRotation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td>
          <td class="paramname"><em>angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structVector.html">Vector</a>&#160;</td>
          <td class="paramname"><em>axis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00223">223</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;                                                                                     {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    </div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    </div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <a class="code" href="structComplex.html">Complex</a> alpha, beta;</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <a class="code" href="QuEST__common_8c.html#a71b3ae4402c1c5039d3086ca0e47a522">getComplexPairFromRotation</a>(angle, axis, &amp;alpha, &amp;beta);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    </div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    </div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, NULL, 0, targetQubit, params, 3);</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00114">getComplexPairFromRotation()</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00575">rotateAroundAxis()</a>.</p>

</div>
</div>
<a id="a9a385fde708958617bbeb599064b8dcb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a385fde708958617bbeb599064b8dcb">&#9670;&nbsp;</a></span>qasm_recordComment()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordComment </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>comment</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00120">120</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                                                         {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="comment">// write formatted comment to buff</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    va_list argp;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    va_start(argp, comment);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">char</span> buff[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a> - 4];</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    vsnprintf(buff, <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>-5, comment, argp);</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    va_end(argp);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="comment">// add chars to buff, write to QASM logger</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordtype">char</span> line[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a> + 1]; <span class="comment">// for trailing \0</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordtype">int</span> len = snprintf(line, <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>, <span class="stringliteral">&quot;%s %s\n&quot;</span>, <a class="code" href="QuEST__qasm_8c.html#a962d0a718e059ba61de06205e75b1e95">COMMENT_PREF</a>, buff);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e79d2452b97b33d5f3c4bf15c5d1a98">addStringToQASM</a>(qureg, line, len);</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00092">addStringToQASM()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00032">COMMENT_PREF</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00034">MAX_LINE_LEN</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00887">applyDiagonalOp()</a>, <a class="el" href="QuEST__common_8c_source.html#l00698">applyExponentiatedPauliHamil()</a>, <a class="el" href="QuEST_8c_source.html#l00844">applyMatrix2()</a>, <a class="el" href="QuEST_8c_source.html#l00853">applyMatrix4()</a>, <a class="el" href="QuEST_8c_source.html#l00863">applyMatrixN()</a>, <a class="el" href="QuEST_8c_source.html#l00874">applyMultiControlledMatrixN()</a>, <a class="el" href="QuEST_8c_source.html#l00819">applyPauliHamil()</a>, <a class="el" href="QuEST_8c_source.html#l00808">applyPauliSum()</a>, <a class="el" href="QuEST_8c_source.html#l00830">applyTrotterCircuit()</a>, <a class="el" href="QuEST_8c_source.html#l00314">controlledMultiQubitUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00270">controlledTwoQubitUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00119">initBlankState()</a>, <a class="el" href="QuEST_8c_source.html#l00145">initPureState()</a>, <a class="el" href="QuEST_8c_source.html#l00157">initStateFromAmps()</a>, <a class="el" href="QuEST_8c_source.html#l01001">mixDephasing()</a>, <a class="el" href="QuEST_8c_source.html#l01023">mixDepolarising()</a>, <a class="el" href="QuEST_8c_source.html#l01065">mixKrausMap()</a>, <a class="el" href="QuEST_8c_source.html#l01085">mixMultiQubitKrausMap()</a>, <a class="el" href="QuEST_8c_source.html#l01054">mixPauli()</a>, <a class="el" href="QuEST_8c_source.html#l01011">mixTwoQubitDephasing()</a>, <a class="el" href="QuEST_8c_source.html#l01042">mixTwoQubitDepolarising()</a>, <a class="el" href="QuEST_8c_source.html#l01075">mixTwoQubitKrausMap()</a>, <a class="el" href="QuEST_8c_source.html#l00331">multiControlledMultiQubitUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00283">multiControlledTwoQubitUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00297">multiQubitUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00642">multiRotatePauli()</a>, <a class="el" href="QuEST_8c_source.html#l00626">multiRotateZ()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00247">qasm_recordControlledParamGate()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00278">qasm_recordControlledUnitary()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00458">qasm_recordInitClassical()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00430">qasm_recordInitPlus()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00324">qasm_recordMultiControlledParamGate()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00341">qasm_recordMultiControlledUnitary()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00362">qasm_recordMultiStateControlledUnitary()</a>, <a class="el" href="QuEST_8c_source.html#l00781">setAmps()</a>, <a class="el" href="QuEST_8c_source.html#l00790">setDensityAmps()</a>, <a class="el" href="QuEST_8c_source.html#l00797">setWeightedQureg()</a>, and <a class="el" href="QuEST_8c_source.html#l00257">twoQubitUnitary()</a>.</p>

</div>
</div>
<a id="a518c4351d574aea8477019dbce02f09c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a518c4351d574aea8477019dbce02f09c">&#9670;&nbsp;</a></span>qasm_recordCompactUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordCompactUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplex.html">Complex</a>&#160;</td>
          <td class="paramname"><em>alpha</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplex.html">Complex</a>&#160;</td>
          <td class="paramname"><em>beta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00195">195</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;                                                                                          {</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    </div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, NULL, 0, targetQubit, params, 3);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00405">compactUnitary()</a>.</p>

</div>
</div>
<a id="a33be8162c9633bb8015f06b38cf70735"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33be8162c9633bb8015f06b38cf70735">&#9670;&nbsp;</a></span>qasm_recordControlledAxisRotation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordControlledAxisRotation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td>
          <td class="paramname"><em>angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structVector.html">Vector</a>&#160;</td>
          <td class="paramname"><em>axis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>controlQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00300">300</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;                                                                                                                 {</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    </div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    </div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <a class="code" href="structComplex.html">Complex</a> alpha, beta;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <a class="code" href="QuEST__common_8c.html#a71b3ae4402c1c5039d3086ca0e47a522">getComplexPairFromRotation</a>(angle, axis, &amp;alpha, &amp;beta);</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    </div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    </div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    <span class="keywordtype">int</span> controls[1] = {controlQubit};</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, controls, 1, targetQubit, params, 3);</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00114">getComplexPairFromRotation()</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00588">controlledRotateAroundAxis()</a>.</p>

</div>
</div>
<a id="a6bd68fa9c0c1bd9c9f9af714ea0b8b03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6bd68fa9c0c1bd9c9f9af714ea0b8b03">&#9670;&nbsp;</a></span>qasm_recordControlledCompactUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordControlledCompactUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplex.html">Complex</a>&#160;</td>
          <td class="paramname"><em>alpha</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplex.html">Complex</a>&#160;</td>
          <td class="paramname"><em>beta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>controlQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00264">264</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;                                                                                                                      {</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    </div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    </div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    </div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="keywordtype">int</span> controls[1] = {controlQubit};</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, controls, 1, targetQubit, params, 3);</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00418">controlledCompactUnitary()</a>.</p>

</div>
</div>
<a id="aa4c380db9eda18892d5a86825fa4b165"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4c380db9eda18892d5a86825fa4b165">&#9670;&nbsp;</a></span>qasm_recordControlledGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordControlledGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>controlQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00238">238</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;                                                                                                {</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <span class="keywordtype">int</span> controls[1] = {controlQubit};</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, controls, 1, targetQubit, 0, 0);    </div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00525">controlledNot()</a>, <a class="el" href="QuEST_8c_source.html#l00537">controlledPauliY()</a>, <a class="el" href="QuEST_8c_source.html#l00549">controlledPhaseFlip()</a>, <a class="el" href="QuEST_8c_source.html#l00613">sqrtSwapGate()</a>, and <a class="el" href="QuEST_8c_source.html#l00601">swapGate()</a>.</p>

</div>
</div>
<a id="ae776148507b8f769cd00d1603212a028"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae776148507b8f769cd00d1603212a028">&#9670;&nbsp;</a></span>qasm_recordControlledParamGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordControlledParamGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>controlQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td>
          <td class="paramname"><em>param</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00247">247</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;                                                                                                                  {</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    </div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordtype">int</span> controls[1] = {controlQubit};</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[1] = {param};</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, controls, 1, targetQubit, params, 1);</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    </div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    <span class="comment">// correct the global phase of controlled phase shifts</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    <span class="keywordflow">if</span> (gate == <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507">GATE_PHASE_SHIFT</a>) {</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;Restoring the discarded global phase of the previous controlled phase gate&quot;</span>);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> phaseFix[1] = {param/2.0};</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>, NULL, 0, targetQubit, phaseFix, 1);</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00032">GATE_PHASE_SHIFT</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00029">GATE_ROTATE_Z</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00499">controlledPhaseShift()</a>, <a class="el" href="QuEST_8c_source.html#l00221">controlledRotateX()</a>, <a class="el" href="QuEST_8c_source.html#l00233">controlledRotateY()</a>, and <a class="el" href="QuEST_8c_source.html#l00245">controlledRotateZ()</a>.</p>

</div>
</div>
<a id="a5e99d405002cdf6ddd40922911d058a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e99d405002cdf6ddd40922911d058a4">&#9670;&nbsp;</a></span>qasm_recordControlledUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordControlledUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a>&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>controlQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>additionally performs Rz on target to restore the global phase lost from u in QASM U(a,b,c) </p>

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00278">278</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;                                                                                                    {</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    </div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    </div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <a class="code" href="structComplex.html">Complex</a> alpha, beta;</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> globalPhase;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <a class="code" href="QuEST__common_8c.html#a73300e3cdca56a7615980274905ba097">getComplexPairAndPhaseFromUnitary</a>(u, &amp;alpha, &amp;beta, &amp;globalPhase);</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    </div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    </div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="keywordtype">int</span> controls[1] = {controlQubit};</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, controls, 1, targetQubit, params, 3);</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    </div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="comment">// add Rz</span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;Restoring the discarded global phase of the previous controlled unitary&quot;</span>);</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> phaseFix[1] = {globalPhase};</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>, NULL, 0, targetQubit, phaseFix, 1);</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00029">GATE_ROTATE_Z</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00136">getComplexPairAndPhaseFromUnitary()</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00361">controlledUnitary()</a>.</p>

</div>
</div>
<a id="a81749d23b8c3c1acf87c9db675872c24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81749d23b8c3c1acf87c9db675872c24">&#9670;&nbsp;</a></span>qasm_recordGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00178">178</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;                                                                    {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    </div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, NULL, 0, targetQubit, NULL, 0);</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00177">hadamard()</a>, <a class="el" href="QuEST_8c_source.html#l00433">pauliX()</a>, <a class="el" href="QuEST_8c_source.html#l00444">pauliY()</a>, <a class="el" href="QuEST_8c_source.html#l00455">pauliZ()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00458">qasm_recordInitClassical()</a>, <a class="el" href="QuEST_8c_source.html#l00466">sGate()</a>, and <a class="el" href="QuEST_8c_source.html#l00477">tGate()</a>.</p>

</div>
</div>
<a id="a55d0f243437a0bb3b7609a1090323aa3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55d0f243437a0bb3b7609a1090323aa3">&#9670;&nbsp;</a></span>qasm_recordInitClassical()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordInitClassical </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long long int&#160;</td>
          <td class="paramname"><em>stateInd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00458">458</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;                                                                   {</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    </div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;    </div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;    <span class="comment">// add an explanatory comment</span></div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="keywordtype">char</span> cmt[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>+1];</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;    sprintf(cmt, <span class="stringliteral">&quot;Initialising state |%lld&gt;&quot;</span>, stateInd);</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, cmt);</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    </div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    <span class="comment">// start in |0&gt;</span></div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e21adca1f0ca03303bc2e57aaba4ce2">qasm_recordInitZero</a>(qureg);</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    </div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;    <span class="comment">// NOT the 1 bits in stateInd</span></div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> q=0; q &lt; qureg.<a class="code" href="structQureg.html#ad08dff5316b8937f4b2a1417591543dc">numQubitsRepresented</a>; q++) </div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;        <span class="keywordflow">if</span> ((stateInd &gt;&gt; q) &amp; 1)</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;            <a class="code" href="QuEST__qasm_8c.html#a81749d23b8c3c1acf87c9db675872c24">qasm_recordGate</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a>, q);</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8h_source.html#l00021">GATE_SIGMA_X</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00034">MAX_LINE_LEN</a>, <a class="el" href="QuEST_8h_source.html#l00208">Qureg::numQubitsRepresented</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00178">qasm_recordGate()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00415">qasm_recordInitZero()</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00134">initClassicalState()</a>.</p>

</div>
</div>
<a id="a627b0be7667c5a61a06b3b038fcc8b1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a627b0be7667c5a61a06b3b038fcc8b1b">&#9670;&nbsp;</a></span>qasm_recordInitPlus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordInitPlus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00430">430</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;                                      {</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;    </div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    </div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    <span class="comment">// add an explanatory comment</span></div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    <span class="keywordtype">char</span> buf[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>+1];</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    sprintf(buf, <span class="stringliteral">&quot;Initialising state |+&gt;&quot;</span>);</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, buf);</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;    </div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;    <span class="comment">// it&#39;s valid QASM to h the register (I think)</span></div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    <span class="comment">// |+&gt; = H |0&gt;</span></div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e21adca1f0ca03303bc2e57aaba4ce2">qasm_recordInitZero</a>(qureg);</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;    <span class="keywordtype">int</span> charsWritten = snprintf(</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;        buf, <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>, <span class="stringliteral">&quot;%s %s;\n&quot;</span>, </div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#a5089baba44776227d7e5a15d3aa1a365">qasmGateLabels</a>[<a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9">GATE_HADAMARD</a>], <a class="code" href="QuEST__qasm_8c.html#a920a8f8a95645f3ce7059fb71e52429a">QUREG_LABEL</a>);</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    <span class="keywordflow">if</span> (charsWritten &gt;= <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>)</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e79d2452b97b33d5f3c4bf15c5d1a98">addStringToQASM</a>(qureg, buf, charsWritten);</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    </div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    <span class="comment">// old code (before above QASM shortcut)</span></div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;<span class="comment">    qasm_recordInitZero(qureg);</span></div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;<span class="comment">    for (int q=0; q &lt; qureg.numQubitsRepresented; q++)</span></div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;<span class="comment">        qasm_recordGate(qureg, GATE_HADAMARD, q);</span></div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00092">addStringToQASM()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00055">bufferOverflow()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00026">GATE_HADAMARD</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00034">MAX_LINE_LEN</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00415">qasm_recordInitZero()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00038">qasmGateLabels</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00027">QUREG_LABEL</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00125">initPlusState()</a>.</p>

</div>
</div>
<a id="a4e21adca1f0ca03303bc2e57aaba4ce2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e21adca1f0ca03303bc2e57aaba4ce2">&#9670;&nbsp;</a></span>qasm_recordInitZero()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordInitZero </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00415">415</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;                                      {</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;    </div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    </div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keywordtype">char</span> line[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a> + 1]; <span class="comment">// for trailing \0</span></div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordtype">int</span> len = snprintf(line, <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>, <span class="stringliteral">&quot;%s %s;\n&quot;</span>, <a class="code" href="QuEST__qasm_8c.html#af5835af166bfcd28887cc722affd4338">INIT_ZERO_CMD</a>, <a class="code" href="QuEST__qasm_8c.html#a920a8f8a95645f3ce7059fb71e52429a">QUREG_LABEL</a>);</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    </div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;    <span class="comment">// check whether we overflowed buffer</span></div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    <span class="keywordflow">if</span> (len &gt;= <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>)</div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    </div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e79d2452b97b33d5f3c4bf15c5d1a98">addStringToQASM</a>(qureg, line, len);</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00092">addStringToQASM()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00055">bufferOverflow()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00031">INIT_ZERO_CMD</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00034">MAX_LINE_LEN</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00027">QUREG_LABEL</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00113">initZeroState()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00458">qasm_recordInitClassical()</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00430">qasm_recordInitPlus()</a>.</p>

</div>
</div>
<a id="a0befde437a58ef8fe38495bfc2a16f0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0befde437a58ef8fe38495bfc2a16f0e">&#9670;&nbsp;</a></span>qasm_recordMeasurement()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordMeasurement </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>measureQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00398">398</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;                                                           {</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160; </div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;    </div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    <span class="keywordtype">char</span> line[<a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a> + 1]; <span class="comment">// for trailing \0</span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;    <span class="keywordtype">int</span> len = snprintf(</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;        line, <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>, <span class="stringliteral">&quot;%s %s[%d] -&gt; %s[%d];\n&quot;</span>,</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#a8a168d461a83e0f5fabbe70d841bac71">MEASURE_CMD</a>, <a class="code" href="QuEST__qasm_8c.html#a920a8f8a95645f3ce7059fb71e52429a">QUREG_LABEL</a>, measureQubit, <a class="code" href="QuEST__qasm_8c.html#ae34d8551a7f88c3736ba02b701782ec0">MESREG_LABEL</a>, measureQubit);</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;        </div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;    <span class="comment">// check whether we overflowed buffer</span></div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    <span class="keywordflow">if</span> (len &gt;= <a class="code" href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a>)</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    </div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a4e79d2452b97b33d5f3c4bf15c5d1a98">addStringToQASM</a>(qureg, line, len);</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00092">addStringToQASM()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00055">bufferOverflow()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00034">MAX_LINE_LEN</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00030">MEASURE_CMD</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00028">MESREG_LABEL</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00027">QUREG_LABEL</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00726">collapseToOutcome()</a>, <a class="el" href="QuEST_8c_source.html#l00758">measure()</a>, and <a class="el" href="QuEST_8c_source.html#l00745">measureWithStats()</a>.</p>

</div>
</div>
<a id="abecd71c919a35e5a87b07ba400edc7c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abecd71c919a35e5a87b07ba400edc7c2">&#9670;&nbsp;</a></span>qasm_recordMultiControlledGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordMultiControlledGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>controlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numControlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00316">316</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;                                                                                                                             {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160; </div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    </div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, controlQubits, numControlQubits, targetQubit, NULL, 0);</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00561">multiControlledPhaseFlip()</a>.</p>

</div>
</div>
<a id="a1445a08d034806627cc0b5aa0f4f6d3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1445a08d034806627cc0b5aa0f4f6d3a">&#9670;&nbsp;</a></span>qasm_recordMultiControlledParamGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordMultiControlledParamGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>controlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numControlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td>
          <td class="paramname"><em>param</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00324">324</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;                                                                                                                                               {</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    </div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    </div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[1] = {param};</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, controlQubits, numControlQubits, targetQubit, params, 1);</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    </div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="comment">// correct the global phase of controlled phase shifts</span></div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    <span class="keywordflow">if</span> (gate == <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507">GATE_PHASE_SHIFT</a>) {</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;Restoring the discarded global phase of the previous multicontrolled phase gate&quot;</span>);</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;        <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> phaseFix[1] = {param/2.0};</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>, NULL, 0, targetQubit, phaseFix, 1);</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    }</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00032">GATE_PHASE_SHIFT</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00029">GATE_ROTATE_Z</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00511">multiControlledPhaseShift()</a>.</p>

</div>
</div>
<a id="a3a79e4305d35f1756b8438bbd34ea6cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a79e4305d35f1756b8438bbd34ea6cc">&#9670;&nbsp;</a></span>qasm_recordMultiControlledUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordMultiControlledUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a>&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>controlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numControlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>additionally performs Rz on target to restore the global phase lost from u in QASM U(a,b,c) </p>

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00341">341</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                                                                                                                                 {</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    </div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;    </div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    <a class="code" href="structComplex.html">Complex</a> alpha, beta;</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> globalPhase;</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;    <a class="code" href="QuEST__common_8c.html#a73300e3cdca56a7615980274905ba097">getComplexPairAndPhaseFromUnitary</a>(u, &amp;alpha, &amp;beta, &amp;globalPhase);</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    </div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    </div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, controlQubits, numControlQubits, targetQubit, params, 3);</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    </div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="comment">// add Rz</span></div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;Restoring the discarded global phase of the previous multicontrolled unitary&quot;</span>);</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> phaseFix[1] = {globalPhase};</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a>, NULL, 0, targetQubit, phaseFix, 1);</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00029">GATE_ROTATE_Z</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00136">getComplexPairAndPhaseFromUnitary()</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00374">multiControlledUnitary()</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00362">qasm_recordMultiStateControlledUnitary()</a>.</p>

</div>
</div>
<a id="a9975b6f54f4090cdf851958bc2b37230"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9975b6f54f4090cdf851958bc2b37230">&#9670;&nbsp;</a></span>qasm_recordMultiStateControlledUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordMultiStateControlledUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a>&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>controlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>controlState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numControlQubits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00362">362</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;  {</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    </div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;NOTing some gates so that the subsequent unitary is controlled-on-0&quot;</span>);</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i &lt; numControlQubits; i++)</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;        <span class="keywordflow">if</span> (controlState[i] == 0)</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;            <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a>, NULL, 0, controlQubits[i], NULL, 0);</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    </div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a3a79e4305d35f1756b8438bbd34ea6cc">qasm_recordMultiControlledUnitary</a>(qureg, u, controlQubits, numControlQubits, targetQubit);</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160; </div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a>(qureg, <span class="stringliteral">&quot;Undoing the NOTing of the controlled-on-0 qubits of the previous unitary&quot;</span>);</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i &lt; numControlQubits; i++)</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;        <span class="keywordflow">if</span> (controlState[i] == 0)</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;            <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a>, NULL, 0, controlQubits[i], NULL, 0);</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00021">GATE_SIGMA_X</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00120">qasm_recordComment()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00341">qasm_recordMultiControlledUnitary()</a>, and <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00389">multiStateControlledUnitary()</a>.</p>

</div>
</div>
<a id="aabeb3e9ec6b2f30938c4cf9592e624fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aabeb3e9ec6b2f30938c4cf9592e624fa">&#9670;&nbsp;</a></span>qasm_recordParamGate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordParamGate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a>&#160;</td>
          <td class="paramname"><em>gate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td>
          <td class="paramname"><em>param</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00186">186</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;                                                                                      {</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[1] = {param};</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, gate, NULL, 0, targetQubit, params, 1);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00488">phaseShift()</a>, <a class="el" href="QuEST_8c_source.html#l00188">rotateX()</a>, <a class="el" href="QuEST_8c_source.html#l00199">rotateY()</a>, and <a class="el" href="QuEST_8c_source.html#l00210">rotateZ()</a>.</p>

</div>
</div>
<a id="ad22260712869e79f07d2f04e2b41a233"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad22260712869e79f07d2f04e2b41a233">&#9670;&nbsp;</a></span>qasm_recordUnitary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_recordUnitary </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structComplexMatrix2.html">ComplexMatrix2</a>&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00207">207</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;                                                                        {</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordflow">if</span> (!qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging)</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <a class="code" href="structComplex.html">Complex</a> alpha, beta;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> discardedGlobalPhase;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <a class="code" href="QuEST__common_8c.html#a73300e3cdca56a7615980274905ba097">getComplexPairAndPhaseFromUnitary</a>(u, &amp;alpha, &amp;beta, &amp;discardedGlobalPhase);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    </div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> rz2, ry, rz1;</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <a class="code" href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a>(alpha, beta, &amp;rz2, &amp;ry, &amp;rz1);</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    </div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> params[3] = {rz2, ry, rz1};</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a>(qureg, <a class="code" href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a>, NULL, 0, targetQubit, params, 3);</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00138">addGateToQASM()</a>, <a class="el" href="QuEST__qasm_8h_source.html#l00031">GATE_UNITARY</a>, <a class="el" href="QuEST__common_8c_source.html#l00136">getComplexPairAndPhaseFromUnitary()</a>, <a class="el" href="QuEST__common_8c_source.html#l00124">getZYZRotAnglesFromComplexPair()</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00349">unitary()</a>.</p>

</div>
</div>
<a id="aa5f05644a6cea13e00f828658bcf7a68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5f05644a6cea13e00f828658bcf7a68">&#9670;&nbsp;</a></span>qasm_setup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_setup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a> *&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00060">60</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                              {</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="comment">// populate and attach QASM logger</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    QASMLogger *qasmLog = malloc(<span class="keyword">sizeof</span> *qasmLog);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    qureg-&gt;<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a> = qasmLog;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">if</span> (qasmLog == NULL)</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    qasmLog-&gt;isLogging = 0;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    qasmLog-&gt;bufferSize = <a class="code" href="QuEST__qasm_8c.html#a5e2b36e0c879b8b31127c6cac37060b5">BUF_INIT_SIZE</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    qasmLog-&gt;buffer = malloc(qasmLog-&gt;bufferSize * <span class="keyword">sizeof</span> *(qasmLog-&gt;buffer));</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordflow">if</span> (qasmLog-&gt;buffer == NULL)</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    </div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="comment">// add headers and quantum / classical register creation</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    qasmLog-&gt;bufferFill = snprintf(</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        qasmLog-&gt;buffer, qasmLog-&gt;bufferSize,</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="stringliteral">&quot;OPENQASM 2.0;\nqreg %s[%d];\ncreg %s[%d];\n&quot;</span>, </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#a920a8f8a95645f3ce7059fb71e52429a">QUREG_LABEL</a>, qureg-&gt;<a class="code" href="structQureg.html#ad08dff5316b8937f4b2a1417591543dc">numQubitsRepresented</a>,</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#ae34d8551a7f88c3736ba02b701782ec0">MESREG_LABEL</a>, qureg-&gt;<a class="code" href="structQureg.html#ad08dff5316b8937f4b2a1417591543dc">numQubitsRepresented</a>);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">if</span> (qasmLog-&gt;bufferFill &gt;= qasmLog-&gt;bufferSize)</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <a class="code" href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a>();</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__qasm_8c_source.html#l00035">BUF_INIT_SIZE</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00055">bufferOverflow()</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00028">MESREG_LABEL</a>, <a class="el" href="QuEST_8h_source.html#l00208">Qureg::numQubitsRepresented</a>, <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>, and <a class="el" href="QuEST__qasm_8c_source.html#l00027">QUREG_LABEL</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00064">createCloneQureg()</a>, <a class="el" href="QuEST_8c_source.html#l00050">createDensityQureg()</a>, and <a class="el" href="QuEST_8c_source.html#l00036">createQureg()</a>.</p>

</div>
</div>
<a id="a84b0328814c0b17e127396cb36065108"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84b0328814c0b17e127396cb36065108">&#9670;&nbsp;</a></span>qasm_startRecording()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_startRecording </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00084">84</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                                      {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging = 1;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00087">startRecordingQASM()</a>.</p>

</div>
</div>
<a id="a77ad622c5ba852708a80755ac1792288"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77ad622c5ba852708a80755ac1792288">&#9670;&nbsp;</a></span>qasm_stopRecording()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qasm_stopRecording </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00088">88</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                                     {</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;isLogging = 0;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00091">stopRecordingQASM()</a>.</p>

</div>
</div>
<a id="a39aeacb22460bd1430129795761ade28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39aeacb22460bd1430129795761ade28">&#9670;&nbsp;</a></span>qasm_writeRecordedToFile()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int qasm_writeRecordedToFile </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>filename</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>returns success of file write </p>

<p class="definition">Definition at line <a class="el" href="QuEST__qasm_8c_source.html#l00489">489</a> of file <a class="el" href="QuEST__qasm_8c_source.html">QuEST_qasm.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;                                                          {</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;    </div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;    FILE *file = fopen(filename, <span class="stringliteral">&quot;w&quot;</span>);</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;    <span class="keywordflow">if</span> (file == NULL)</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;    </div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    fprintf(file, <span class="stringliteral">&quot;%s&quot;</span>, qureg.<a class="code" href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">qasmLog</a>-&gt;buffer);</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;    fclose(file);</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    <span class="keywordflow">return</span> 1;</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00232">Qureg::qasmLog</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l00103">writeRecordedQASMToFile()</a>.</p>

</div>
</div>
</div><!-- contents -->
<div class="ttc" id="aQuEST__qasm_8c_html_a8a168d461a83e0f5fabbe70d841bac71"><div class="ttname"><a href="QuEST__qasm_8c.html#a8a168d461a83e0f5fabbe70d841bac71">MEASURE_CMD</a></div><div class="ttdeci">#define MEASURE_CMD</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00030">QuEST_qasm.c:30</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a09a3b394b8602092d58347b791158062"><div class="ttname"><a href="QuEST__qasm_8c.html#a09a3b394b8602092d58347b791158062">MAX_LINE_LEN</a></div><div class="ttdeci">#define MAX_LINE_LEN</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00034">QuEST_qasm.c:34</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_ae34d8551a7f88c3736ba02b701782ec0"><div class="ttname"><a href="QuEST__qasm_8c.html#ae34d8551a7f88c3736ba02b701782ec0">MESREG_LABEL</a></div><div class="ttdeci">#define MESREG_LABEL</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00028">QuEST_qasm.c:28</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fadfa058950331ffdba0bf56cb2272e01f"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fadfa058950331ffdba0bf56cb2272e01f">GATE_T</a></div><div class="ttdeci">@ GATE_T</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00024">QuEST_qasm.h:24</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa4668b36d21aaeba1fb605b73881ca507">GATE_PHASE_SHIFT</a></div><div class="ttdeci">@ GATE_PHASE_SHIFT</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00032">QuEST_qasm.h:32</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a4e21adca1f0ca03303bc2e57aaba4ce2"><div class="ttname"><a href="QuEST__qasm_8c.html#a4e21adca1f0ca03303bc2e57aaba4ce2">qasm_recordInitZero</a></div><div class="ttdeci">void qasm_recordInitZero(Qureg qureg)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00415">QuEST_qasm.c:415</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fada07505b73935b2788032efd30a1a361"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fada07505b73935b2788032efd30a1a361">GATE_ROTATE_X</a></div><div class="ttdeci">@ GATE_ROTATE_X</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00027">QuEST_qasm.h:27</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa0cdc4c588d02a515a68515dd3f24d877">GATE_ROTATE_Z</a></div><div class="ttdeci">@ GATE_ROTATE_Z</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00029">QuEST_qasm.h:29</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa228cd6a7ad18928b794ee7ad1f1fc85e"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa228cd6a7ad18928b794ee7ad1f1fc85e">GATE_SIGMA_Z</a></div><div class="ttdeci">@ GATE_SIGMA_Z</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00023">QuEST_qasm.h:23</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa8417e56d80add49216437e0d451e8dd9">GATE_HADAMARD</a></div><div class="ttdeci">@ GATE_HADAMARD</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00026">QuEST_qasm.h:26</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_a71b3ae4402c1c5039d3086ca0e47a522"><div class="ttname"><a href="QuEST__common_8c.html#a71b3ae4402c1c5039d3086ca0e47a522">getComplexPairFromRotation</a></div><div class="ttdeci">void getComplexPairFromRotation(qreal angle, Vector axis, Complex *alpha, Complex *beta)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00114">QuEST_common.c:114</a></div></div>
<div class="ttc" id="agroup__type_html_ga7740e349b4f8bae6451547680f0ce2d6"><div class="ttname"><a href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a></div><div class="ttdeci">#define qreal</div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fab656861dfb036cbcf7009f02a8949253"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab656861dfb036cbcf7009f02a8949253">GATE_SQRT_SWAP</a></div><div class="ttdeci">@ GATE_SQRT_SWAP</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00034">QuEST_qasm.h:34</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa13c9487aed515148e7594e35eb8dcc55">GATE_SIGMA_X</a></div><div class="ttdeci">@ GATE_SIGMA_X</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00021">QuEST_qasm.h:21</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_af5835af166bfcd28887cc722affd4338"><div class="ttname"><a href="QuEST__qasm_8c.html#af5835af166bfcd28887cc722affd4338">INIT_ZERO_CMD</a></div><div class="ttdeci">#define INIT_ZERO_CMD</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00031">QuEST_qasm.c:31</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab2d42b150aaa78844dea6661954ea5b7">GATE_UNITARY</a></div><div class="ttdeci">@ GATE_UNITARY</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00031">QuEST_qasm.h:31</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a5089baba44776227d7e5a15d3aa1a365"><div class="ttname"><a href="QuEST__qasm_8c.html#a5089baba44776227d7e5a15d3aa1a365">qasmGateLabels</a></div><div class="ttdeci">static const char * qasmGateLabels[]</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00038">QuEST_qasm.c:38</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a9a385fde708958617bbeb599064b8dcb"><div class="ttname"><a href="QuEST__qasm_8c.html#a9a385fde708958617bbeb599064b8dcb">qasm_recordComment</a></div><div class="ttdeci">void qasm_recordComment(Qureg qureg, char *comment,...)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00120">QuEST_qasm.c:120</a></div></div>
<div class="ttc" id="astructQureg_html_a6b7912365d7ad8ff9b986fcad0c6ca3a"><div class="ttname"><a href="structQureg.html#a6b7912365d7ad8ff9b986fcad0c6ca3a">Qureg::qasmLog</a></div><div class="ttdeci">QASMLogger * qasmLog</div><div class="ttdoc">Storage for generated QASM output.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00232">QuEST.h:232</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_aa5d1d9dde42b0471faf2d887ebee0540"><div class="ttname"><a href="QuEST__qasm_8c.html#aa5d1d9dde42b0471faf2d887ebee0540">bufferOverflow</a></div><div class="ttdeci">void bufferOverflow(void)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00055">QuEST_qasm.c:55</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a4e79d2452b97b33d5f3c4bf15c5d1a98"><div class="ttname"><a href="QuEST__qasm_8c.html#a4e79d2452b97b33d5f3c4bf15c5d1a98">addStringToQASM</a></div><div class="ttdeci">void addStringToQASM(Qureg qureg, char line[], int lineLen)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00092">QuEST_qasm.c:92</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a920a8f8a95645f3ce7059fb71e52429a"><div class="ttname"><a href="QuEST__qasm_8c.html#a920a8f8a95645f3ce7059fb71e52429a">QUREG_LABEL</a></div><div class="ttdeci">#define QUREG_LABEL</div><div class="ttdoc">TODO.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00027">QuEST_qasm.c:27</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a962d0a718e059ba61de06205e75b1e95"><div class="ttname"><a href="QuEST__qasm_8c.html#a962d0a718e059ba61de06205e75b1e95">COMMENT_PREF</a></div><div class="ttdeci">#define COMMENT_PREF</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00032">QuEST_qasm.c:32</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a3a79e4305d35f1756b8438bbd34ea6cc"><div class="ttname"><a href="QuEST__qasm_8c.html#a3a79e4305d35f1756b8438bbd34ea6cc">qasm_recordMultiControlledUnitary</a></div><div class="ttdeci">void qasm_recordMultiControlledUnitary(Qureg qureg, ComplexMatrix2 u, int *controlQubits, int numControlQubits, int targetQubit)</div><div class="ttdoc">additionally performs Rz on target to restore the global phase lost from u in QASM U(a,...</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00341">QuEST_qasm.c:341</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a5e2b36e0c879b8b31127c6cac37060b5"><div class="ttname"><a href="QuEST__qasm_8c.html#a5e2b36e0c879b8b31127c6cac37060b5">BUF_INIT_SIZE</a></div><div class="ttdeci">#define BUF_INIT_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00035">QuEST_qasm.c:35</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_a404d177b894ce008289e44a599ad77d6"><div class="ttname"><a href="QuEST__common_8c.html#a404d177b894ce008289e44a599ad77d6">getZYZRotAnglesFromComplexPair</a></div><div class="ttdeci">void getZYZRotAnglesFromComplexPair(Complex alpha, Complex beta, qreal *rz2, qreal *ry, qreal *rz1)</div><div class="ttdoc">maps U(alpha, beta) to Rz(rz2) Ry(ry) Rz(rz1)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00124">QuEST_common.c:124</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_ab81554f09cb62b7d53dffec8a3209529"><div class="ttname"><a href="QuEST__qasm_8c.html#ab81554f09cb62b7d53dffec8a3209529">addGateToQASM</a></div><div class="ttdeci">void addGateToQASM(Qureg qureg, TargetGate gate, int *controlQubits, int numControlQubits, int targetQubit, qreal *params, int numParams)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00138">QuEST_qasm.c:138</a></div></div>
<div class="ttc" id="astructQureg_html_ad08dff5316b8937f4b2a1417591543dc"><div class="ttname"><a href="structQureg.html#ad08dff5316b8937f4b2a1417591543dc">Qureg::numQubitsRepresented</a></div><div class="ttdeci">int numQubitsRepresented</div><div class="ttdoc">The number of qubits represented in either the state-vector or density matrix.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00208">QuEST.h:208</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa5053f3d968443bc04e8b1d09f18bab9a"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa5053f3d968443bc04e8b1d09f18bab9a">GATE_S</a></div><div class="ttdeci">@ GATE_S</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00025">QuEST_qasm.h:25</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fab12d052de2b7c59c6ab87710fd7d3c78"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fab12d052de2b7c59c6ab87710fd7d3c78">GATE_SWAP</a></div><div class="ttdeci">@ GATE_SWAP</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00033">QuEST_qasm.h:33</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725f"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725f">TargetGate</a></div><div class="ttdeci">TargetGate</div><div class="ttdoc">! Identifiers of single-target gates</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00020">QuEST_qasm.h:20</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fa7b60ebf9485dea5506345487c903c7d3"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fa7b60ebf9485dea5506345487c903c7d3">GATE_ROTATE_AROUND_AXIS</a></div><div class="ttdeci">@ GATE_ROTATE_AROUND_AXIS</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00030">QuEST_qasm.h:30</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725faa29b98cbb581abf5ec338a1763de7a1b"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725faa29b98cbb581abf5ec338a1763de7a1b">GATE_SIGMA_Y</a></div><div class="ttdeci">@ GATE_SIGMA_Y</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00022">QuEST_qasm.h:22</a></div></div>
<div class="ttc" id="astructComplex_html"><div class="ttname"><a href="structComplex.html">Complex</a></div><div class="ttdoc">Represents one complex number.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00103">QuEST.h:103</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a81749d23b8c3c1acf87c9db675872c24"><div class="ttname"><a href="QuEST__qasm_8c.html#a81749d23b8c3c1acf87c9db675872c24">qasm_recordGate</a></div><div class="ttdeci">void qasm_recordGate(Qureg qureg, TargetGate gate, int targetQubit)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00178">QuEST_qasm.c:178</a></div></div>
<div class="ttc" id="aQuEST__qasm_8h_html_a32bbd0276b80668812ac248cd81c725fae1267d5de573dc2901aa8e724ac1d689"><div class="ttname"><a href="QuEST__qasm_8h.html#a32bbd0276b80668812ac248cd81c725fae1267d5de573dc2901aa8e724ac1d689">GATE_ROTATE_Y</a></div><div class="ttdeci">@ GATE_ROTATE_Y</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8h_source.html#l00028">QuEST_qasm.h:28</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_a73300e3cdca56a7615980274905ba097"><div class="ttname"><a href="QuEST__common_8c.html#a73300e3cdca56a7615980274905ba097">getComplexPairAndPhaseFromUnitary</a></div><div class="ttdeci">void getComplexPairAndPhaseFromUnitary(ComplexMatrix2 u, Complex *alpha, Complex *beta, qreal *globalPhase)</div><div class="ttdoc">maps U(r0c0, r0c1, r1c0, r1c1) to exp(i globalPhase) U(alpha, beta)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00136">QuEST_common.c:136</a></div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
</body>
        <script type="text/javascript" src="boot.js"></script>
</html>
